<template>
  <view :class="themeClass">
    <slot />
  </view>
</template>

<script setup lang="ts">
import { computed, onMounted } from 'vue'
import { useThemeStore } from '@/stores/theme'

// 使用主题 store
const themeStore = useThemeStore()

// 计算主题类名
const themeClass = computed(() => {
  const theme = themeStore.currentTheme
  return theme === 'blue' ? '' : `theme-${theme}`
})

// 初始化主题
onMounted(() => {
  themeStore.initTheme()
})
</script> 